var ibMarketItemsList = {
	directories: $A(),
	
	/*------------------------------*/
	/* Constructor 					*/
	init: function()
	{
		Debug.write("Initializing addItem.js");
	},
	register: function(directory)
	{
		Debug.write('ibMarket add item list dropdown' + directory);
		
		this.directories[this.directories.size()] = $(directory);
		
		$(directory).observe('change', this.changeValue.bindAsEventListener( this ));
		$(directory).observe('keyup', this.changeValue.bindAsEventListener( this ));
	},
	changeValue: function(event)
	{
		this.revertDropDown(event.element().identify());
	},
	revertDropDown: function(noRevert)
	{
		this.directories.each(function(element)
		{
			if(element.identify() != noRevert)
			{
				element.selectedIndex = 0;
			}
		});
		
	}
}

ibMarketItemsList.init();